package com.synergy.stockflow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 枚举类型表
 */
@Schema(description = "枚举类型表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_dict_type")
public class SysDictType {
    /**
     * 枚举类型编号
     */
    @TableId(value = "dict_type_id", type = IdType.INPUT)
    @Schema(description = "枚举类型编号")
    private Integer dictTypeId;

    /**
     * 类型编码
     */
    @TableField(value = "type_code")
    @Schema(description = "类型编码")
    private String typeCode;

    /**
     * 类型名称
     */
    @TableField(value = "type_name")
    @Schema(description = "类型名称")
    private String typeName;

    /**
     * 类型描述
     */
    @TableField(value = "description")
    @Schema(description = "类型描述")
    private String description;

    /**
     * 状态 (0:禁用, 1:启用)
     */
    @TableField(value = "`status`")
    @Schema(description = "状态 (0:禁用, 1:启用)")
    private Byte status;

    /**
     * 创建人编号
     */
    @TableField(value = "create_by")
    @Schema(description = "创建人编号")
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新者编号
     */
    @TableField(value = "update_by")
    @Schema(description = "更新者编号")
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 逻辑删除 (0:默认, 1:删除)
     */
    @TableField(value = "del_flag")
    @Schema(description = "逻辑删除 (0:默认, 1:删除)")
    private Byte delFlag;

    @TableField(exist = false)
    @Schema(description = "值列表")
    private List<SysDictItem> items;
}